import React, { useState } from 'react';

export default function Child() {
    console.log('re-render Child');
    const [age, setAge] = useState(0);
    return (
        <main className='container p-4 border'>
            <div className='p-4'>child age: {age}</div>
            <button
                className='p-2 border'
                type='button'
                onClick={() => {
                    setAge(age + 1);
                }}
            >
                AddAge
            </button>
        </main>
    );
}
